<template>
	<view class="content">
		<view class="yy-secion-header skeleton-rect">
			<view class="left">
				<view class="line"></view>
				<view class="title">热门医生</view>
			</view>
			<view class="right" @click="clickMore">
				<view class="subs">更多</view>
				<text class="iconfont icon-xiangyou"></text>
			</view>
		</view>
		<view class="yy-doctor-box skeleton-rect">
			<view class="yy-doctor-item" v-for="(item,index) in itemList" @click="goDoctorHome(item)">
				<view class="pic-box">
					<image :src="item.avatar" mode="aspectFill"></image>
				</view>
				<view class="doctor-name">{{ item.name }}</view>
				<view class="doctor-des yy-text-line yy-text-line2"> {{ item.desc }}</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex';
	export default {
		name:'homeHot',
		props:{
			dataList: {
				type: Array,
				default: () => []
			},
		},
		computed: {
			...mapGetters(['viewColor', 'isLogin']),
		},
		watch:{
			dataList(){
				this.itemList = this.dataList;
			}
		},
		data() {
			return {
				itemList:[],
				
			}
		},
		created() {
			
		},
		mounted() {
			
		},
		methods: {
			clickMore(){
				uni.navigateTo({
					url:'/pages/shops/subs_index/hot/list',
				})
			},
			/**
			 * 医生主页
			 */
			goDoctorHome(item){
				if (!this.isLogin) {
					this.$emit('goLogin');
					return
				}
				uni.navigateTo({
					url:'/pages/shops/subs_inquiry/doctor/index?doctor_id='+item.id,
				});
			}
		}
	}
	
</script>

<style lang="scss">
	.content {
		margin-top: 20rpx;
		padding: 0 30rpx 30rpx;
		background-color: #fff;
	}
	
</style>